<?php
/**
 * Desc:
 * User: zdb
 * Date: 2023/5/8
 * Time: 16:52
 */
namespace app\util;

class ResponseUtil
{
    public static function success($data = [], $message = 'ok')
    {
        $data = ['code' => 1 , 'message' => $message, 'data' => $data];
        return json($data);
    }

    public static function failure($message, $code = 0)
    {
        $data = ['code' => $code , 'message' => $message];
        return json($data);
    }

    public static function ajaxReturn($data){
        return json($data);
    }
}